package gdut.stream.middle;

import java.util.List;
import java.util.Objects;

public class Student {
    private Integer age;
    private String name;
    private List<String> books;

    public Student() {
    }

    public Student(Integer age, String name) {
        this.age = age;
        this.name = name;
    }

    public Student(Integer age, String name, List<String> books) {
        this.age = age;
        this.name = name;
        this.books = books;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getBooks() {
        return books;
    }

    public void setBooks(List<String> books) {
        this.books = books;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(age, student.age) &&
                Objects.equals(name, student.name) &&
                Objects.equals(books, student.books);
    }

    @Override
    public int hashCode() {
        return Objects.hash(age, name, books);
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                ", books=" + books +
                '}';
    }
}
